/*
 * Copyright 2006-2023 ahtelit.com, All Rights Reserved.
 */

package com.telit.firecommand.controller;

import com.telit.common.core.utils.Result;
import com.telit.firecommand.entity.CameraSet;
import com.telit.firecommand.service.CameraSetService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;


/**
 * 监控云台操作设置记录
 *
 * @author yuezhuang
 * @since 2023-11-21
 */
@RequiredArgsConstructor
@Api(tags = "[监控云台操作设置记录]模块")
@RestController
@RequestMapping("/camera-set")
public class CameraSetController {

    private final CameraSetService cameraSetService;

    @ApiOperation(value = "新增")
    @PostMapping("add")
    public Result<?> add(@RequestBody CameraSet dto) {
        cameraSetService.add(dto);
        return new Result<>();
    }

    @ApiOperation(value = "修改")
    @PostMapping("edit")
    public Result<?> edit(@RequestBody CameraSet dto) {
        cameraSetService.edit(dto);
        return new Result<>();
    }

    @ApiOperation(value = "详情")
    @GetMapping("detail")
    public Result<CameraSet> detail(String cameraIndexCode) {
        return new Result<>(cameraSetService.detail(cameraIndexCode));
    }

}
